<template>
<div id="trading_info">
	<div class="search_box">
		<div class="container">
			<p>{{ $lang("TRANSACTE_INFO") }}</p>
		</div>
	</div>
	<div class="tran_table">
		<div class="container">
			<div class="bread_rumb clearfix">
				<div class="f_l">
					<el-breadcrumb separator-class="el-icon-arrow-right">
					  <el-breadcrumb-item :to="{ path: '/AllCompany' }">{{ $lang('ALL_COMPANY') }}</el-breadcrumb-item>
					  <el-breadcrumb-item>{{ $lang('TRANSACTE_INFO') }}</el-breadcrumb-item> 
					</el-breadcrumb>
				</div>
				<!-- <div class="f_r">
					<el-breadcrumb separator-class="el-icon-arrow-right">
						<el-breadcrumb-item >{{ $lang('TRANSACTION') }}</el-breadcrumb-item>
					  <el-breadcrumb-item :to="{ path: 'blocks' }">{{ $lang('BLOCK_TAB') }}</el-breadcrumb-item>
					</el-breadcrumb>
				</div> -->
			</div>
			<el-table
                :data="list"
                style="width: 100%;border:10px;background-color: #212C4F;"
                :empty-text="$lang('NODATA')"
                :row-style="{
                    'border':'none',
                    'background-color':'#1D2748',
                    'border-bottom':'none',
                    'border-radis':'5px',
                }">
		    <el-table-column
		      prop="hash"
		      :label="$lang('CURRENT_HASH')"
		      width="400">
		    </el-table-column>
		    <el-table-column
		      prop="name"
		      :label="$lang('SENDER')"
		      width="120">
		    </el-table-column>
		    <el-table-column
		      prop="receiptaddress"
		      :label="$lang('RECEIVER')">
		    </el-table-column>
		    <el-table-column
		      prop="tradetype"
		      :label="$lang('TYPE')"
		      width="140">
		    </el-table-column>
		    <el-table-column
		      prop="blockheight"
		      :label="$lang('NUMS')"
		      width="140">
		    </el-table-column>
		    <el-table-column
		      prop="value"
		      :label="$lang('FEES')">
		    </el-table-column>
            <el-table-column
		      prop="value"
		      :label="$lang('CONFIRM')">
		    </el-table-column>
		  </el-table>
		  <el-pagination
                v-if="list !== null"
                :current-page="currentPage"
                layout="prev, pager, next"			  
                :total="pageTotal"
                @current-change="changePage">
			</el-pagination>
		</div>
	</div>
</div>
</template>

<script>
import { gets } from '@/api/api.js';

export default {
	data(){
		return {
			input:"",
			currentPage:1, // 分页当前页
			pageSize:5, // 每页条数
			pageTotal:100,
			list:null,
		}
	},
	mounted(){
		// this.getPageList();
		
	},
	methods:{
		changePage(currentPage){
			this.currentPage = currentPage;
			// this.getPageList();
		},
		async getPageList(){
			try {
				const res = await gets.pageList('/transaction/pageList', {
					pageNum:this.currentPage,
					pageSize:this.pageSize
				});
				this.pageTotal = res.pages;
				this.list = res.list;
				console.log(this.list)
			} catch (e) {
				throw e;
			}
		}
	}
	
}
</script>
<style lang="scss" scoped >
@import '~assets/scss/trading_info.scss';
</style>